<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function myFunawdawdawdction() {
            try {
                var x = document.getElementById("deadwadmo").value;
                if (x == "") throw "值为空";
                if (isNaN(x)) throw "不是数字";
                if (x > 10) throw "太大";
                if (x < 5) throw "太小";
            }
            catch (err) {
                var y = document.getElementById("mess");
                y.innerHTML = "错误：" + err + "。";
            }
        }
    </script>
</head>

<body>
    <div>
        <script>
            var txt = "";
            function message() {
                try {
                    adddlert("Welcome guest!");
                }
                catch (err) {
                    txt = "本页有一个错误。\n\n";
                    txt += "错误描述：" + err.message + "\n\n";
                    txt += "点击确定继续。\n\n";
                    alert(txt);
                }
            }
        </script>
        <div>
            <input type="button" value="查看消息" onclick="message()" />
        </div>
    </div>
    <div>
        <p>请输出一个 5 到 10 之间的数字:</p>
        <input id="deadwadmo" type="text">
        <button type="button" onclick="myFunawdawdawdction()">测试输入</button>
        <p id="mess"></p>
    </div>
</body>


</html>